$(document).ready(function() {  
    console.log("contentScript.js: initialized...");
    console.log("contentScript.js: currently browsing page @ '"+$(location).attr('href')+"'");
    setUpRequestListener();
});


/////////////////////////////////// FUNCTION TO HANDLE MESSAGE PASSING TO AND FROM CONTENT SCRIPTS
function setUpRequestListener() {
    
    chrome.extension.onRequest.addListener(
        function(request, sender, sendResponse) {
            console.log("contentScript.js: request received....");
            sendResponse({
                URL: $(location).attr('href'),
                title: document.title
            });
        });
}

